<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <title>扫码</title>
    <script src="${pageContext.request.contextPath}/static/js/KeysManager/index.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/KeysManager/ScanCode.css?v=3">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/layer_mobile/need/layer.css" />
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/yahlj-app.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer_mobile/layer.js"></script>
</head>

<style>

</style>
<body>
<div class="img-box">
    <img src="${pageContext.request.contextPath}/static/images/KeysManager/computer.png" class="img">
</div>

<p id="text">即将在电脑上登陆</p>
<p>请确认是否是本人操作</p>

<div class="button-box">
    <button id="ok" onclick="yes()">确认</button>
    <button id="cancel"  onclick="no()">取消</button>
</div>

</body>
</html>
<script>
function yes(){
	layer.open({
	    type: 2
	    ,content: '登录中'
	});
	$.ajax({   
	    url:'<%=request.getContextPath()%>/admin/yesLoginByQrcode.action',   
	    type:'post',   
	    data:'k=',   
	    async : true, //默认为true 异步   
	    dataType:'json',
	    error: function(XMLHttpRequest, textStatus, errorThrown) {
	    	layer.closeAll();
	    },  
	    success:function(result){
	    	layer.closeAll();
	    	var data = result.data;
	       if(result.code=='1'){
	    	  no();
	       }else{
	    		layer.open({
	    		    content:result.msg,
	    		    skin: 'msg',
	    		    time:2
	    		});
	    	   //layer.alert();
	       }
	    }
	});
}


function no(){
	hljJs.closeWindow({
		success:function(res){
			console.log(res);		
		},
		fail:function(res){
			console.log(res);
		}
	});
}
</script>